package br.com.winesys.geta.databinding.componentBinder;

import java.util.ArrayList;
import java.util.List;
import br.com.winesys.geta.databinding.ComponentBinder;
import br.com.winesys.geta.databinding.component.table.TableEditor;

public final class TableEditorBinder implements ComponentBinder<TableEditor<Object>> {

	private static final ComponentBinder<TableEditor<Object>> INSTANCE = new TableEditorBinder();

	public static ComponentBinder<TableEditor<Object>> getInstance() {
		return INSTANCE;
	}

	private TableEditorBinder() {
	}

	@Override
	public Object read(TableEditor<Object> component) {
		return new ArrayList<Object>(component.getValues());
	}

	@Override
	public void write(TableEditor<Object> component, Object value) {
		component.setValues((List<Object>) value);
	}
}
